Optimizing power usage by factoring processor architectural events to pmu

ABSTRACT

A method and apparatus to monitor architecture events is disclosed. The architecture events are linked together via a push bus mechanism with each architectural event having a designated time slot. There is at least one branch of the push bus in each core. Each branch of the push bus may monitor one core with all the architectural events. All the data collected from the events by the push bus is then sent to a power control unit.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.14/972,765, filed Dec. 17, 2015, which is a continuation of U.S. patentapplication Ser. No. 14/598,454, filed Jan. 16, 2015, which is acontinuation of U.S. patent application Ser. No. 14/182,385, filed Feb.18, 2014, now U.S. Pat. No. 8,966,299, Issued on Feb. 24, 2015, which isa continuation of U.S. patent application Ser. No. 13/787,085, filedMar. 6, 2013, now U.S. Pat. No. 8,700,933, Issued on Apr. 15, 2014,which is a continuation of U.S. patent application Ser. No. 13/329,700,filed Dec. 19, 2011, now U.S. Pat. No. 8,412,970, Issued on Apr. 2,2013, which is a continuation of U.S. patent application Ser. No.11/618,477, filed Dec. 29, 2006, now U.S. Pat. No. 8,117,478, Issued onFeb. 14, 2012, all of which is herein incorporated by reference.

BACKGROUND INFORMATION

Processor power consumption has become a major issue in recent years.The current trend of processor design to multi-core architecture aseased the pressure on power consumption. However, power consumptionstill grows linearly with the number of cores being designed.

Recent developments in technology have provided new opportunities tofurther optimize power consumptions. However, these technologies stillhave several downsides. Specifically, within the new technologies, OSdoes not understand how effectively the workload is running in thehardware and the associated power cost in the hardware. Secondly, OSinteraction is very slow to react. Thirdly, the current OS do notcontrol performance power state per core. Finally, turbo mode only takesthermal and sensor feedback, it does take into account the cores higherperformance requirement.

BRIEF DESCRIPTION OF THE DRAWINGS

Various features of the invention will be apparent from the followingdescription of preferred embodiments as illustrated in the accompanyingdrawings, in which like reference numerals generally refer to the sameparts throughout the drawings. The drawings are not necessarily toscale, the emphasis instead being placed upon illustrating theprinciples of the inventions.

FIG. 1 illustrates a diagram of a thermal sensor and architecture eventsconnection to a PCU in accordance with one embodiment of the invention.

FIG. 2 illustrates a flow chart of a method for architecture event powercontroller in accordance with one embodiment of the invention.

FIG. 3 is a block diagram of computer system in accordance with anembodiment of the invention.

FIG. 4 is a block diagram of a computing system arranged in apoint-to-point configuration, according to one embodiment of theinvention.

DETAILED DESCRIPTION

In the following description, for purposes of explanation and notlimitation, specific details are set forth such as particularstructures, architectures, interfaces, techniques, etc. in order toprovide a thorough understanding of the various aspects of theinvention. However, it will be apparent to those skilled in the arthaving the benefit of the present disclosure that the various aspects ofthe invention may be practiced in other examples that depart from thesespecific details. In certain instances, descriptions of well-knowndevices, circuits, and methods are omitted so as not to obscure thedescription of the present invention with unnecessary detail.

Some of the embodiments discussed herein may be utilized to performevent handling operations. In an embodiment, an “event” refers to acondition that may or may not require some action to be taken by logic.Furthermore, events may be classified into different types based on theaction that is to be taken.

In one embodiment, and “architectural event” refers to an event orcondition that may be monitored (e.g., by programming informationcorresponding to the architectural event into a state). In anembodiment, software may configure a channel to monitor certainarchitectural event which may not otherwise be observable by softwareand/or hardware. In an embodiment, an architectural event may generallyrefer to an event or condition that occurs within processing resourcesor other logic present on the same integrated circuit chip as aprocessor.

In an embodiment, architecture events are one factor for making powermanagement decisions. Architecture events are widely used for softwareperformance optimization. By factoring in architecture events for makingpower management decisions, the embodiment may effectively detect coreexecution condition that neither OS nor turbo mode can currently detect.

One embodiment provides additional value to a power control unit (PCU)to make appropriate power decisions using existing designs. The PCUhandles thermal events, schedules/manages per core's frequencyincrease/decrease. In the embodiment, logic is added in the PCU. The PCUthen takes feedback from counters to assist in making decisions to scaleup a particular core.

Architecture events inside a processor are usually detected by a seriesof physical counters implemented in different areas of the processor.These counters maybe referred to as EMON counters. EMON counters areperformance monitoring counters that reside in each function unit thatcounts the number of specific events that has occurred during a periodof time.

There may be public EMON counters and private EMON counters. Public EMONcounters are those accessible by vendors and users, while private EMONcounters are used internally for debugging. Both public and private EMONcounters may be used for software and hardware tuning. EMON counters arevery useful tools to understand the application behavior and howeffective the current application is doing inside the processor.

Instruction retried is one type of EMON counter. By knowing instructionretired per cycle, the system knows how fast the current application isexecuting inside the processor. More instruction retired per cycle, thebetter performance the application is getting.

Another type EMON counter is a MLC/LLC cache miss. Programs experiencelots of MLC/LLC cache miss usually means they require higher BW tosystem interconnect. It also means the program will not be effectivelyexecuting instruction since most of time the problem will be stalledwaiting for data return.

Branch Misprediction is also a type of EMON counter. This is a goodindicator to show that the core is not doing lots of “useful” work sinceit is working on the wrong branch of instruction stream.

TLB miss is also a type of EMON counter. Similar to MLC/LLC miss, a TLBmiss usually means stalling the core until data has returned.

There are many more counters defined in any processor. For example,Intel's P4 processor contains more than 200 counters. Some of thecounters are for performance tuning while others are fordebug/validation purposes. The four counters mentioned above,instruction retired, MLC/LLC cache miss, branch misprediction and TLBmiss are crucial to the power management discussed here within.

However, it should be noted that the present disclosure is not limitedto the above identified counters. Rather, the present disclosure maytake as many architectural events as needed. The present system utilizesa push bus mechanism that can connect all counters serially on the samebus since these counters do not require high bandwidth or high refreshrate.

FIG. 1 illustrates a diagram of a thermal sensor and architecture eventsconnection 100 to a PCU in accordance with one embodiment of theinvention. FIG. 1 illustrates a processor with eight cores 105 and fourshared last level caches (LLC) 107. It should be noted that the eightcores and four shared LLCs are shown for illustrative purposes only. Anynumber of cores or LLCs may be used for this embodiment. A functionalunit 110 is shared among the cores 105. The PCU 115 is one of the unitsto be shared by the cores 105.

The dark squares in the cores 105 represent thermal sensors 120. Thecores 105 have thermal sensors 105 to prevent over heating of the cores105. A serial push bus 125 connects all the sensors 120 on the bus. Thepush bus 125 may have various branches. A first branch 127 of the pushbus 125 may take up to 96 time slots, where each time slot is reservedfor one of the thermal sensors 120. There is at least one branch 127 ofthe push bus 125 in each core 105. Each branch 127 of the push bus 105may monitor one core 105 with all the thermal sensors 120. All the datacollected from the thermal sensors 120 by the push bus 125 is then sentto the PCU 115.

A similar approach is made to monitor architectural events by linkingdifferent counters via the same serial push bus mechanism and eachcounter having a designated time slot. The light squares are EMONcounters 130. The dotted line 135 is another branch of the serial pushbus. The second branch 135 of the push bus 125 may take up to 96 timeslots, where each time slot is reserved for one of the EMON counters.There is at least one branch 135 of the push bus 125 in each core 105.Each branch 135 of the push bus 125 may monitor one core 105 with allthe EMON counters 130. All the data collected from the EMON counters 130by the push bus 125 is then sent to the PCU 115.

The PCU 115 may have very low sampling rate to retrieve information fromthe push bus 125 which is one reason why all the sensors may share anarrow bus. The serial push bus 125 may not be more than 10 bits wideand runs a low sampling rate. Due to this, there is no high bandwidthrequirement to monitor these events. Sampling the counters every 1000cycles may be sufficient. The sampling frequency should be tuned withthe thermal sensors so that PCU 115 decisions may be made coherentbetween architectural events 130 and thermal sensors 120.

FIG. 2 illustrates a flow chart of a method 200 for architecture eventpower controller in accordance with one embodiment of the invention. Themethod 200 begins when the system is in idle mode 205. When each timerinterval is reached, architectural event power optimization logic(AEPOL) examines the counts and decides whether a power up or power downsequence should be initiated 210.

For a power up sequence, AEPOL queries PCU 115 to determine if turbomode is available 215. If turbo mode is not available, meaning noreserve power is available, AEPOL goes back to idle more 205 until thenext timer interval arrives. If turbo mode is available, AEPOL initiatesa power up sequence 220. Once the power up sequence is completed AEPOLgoes into idle mode 205 until the next timer interval.

For a power down sequence, AEPOL notifies PCU 115 to initiate power downsequence 225. Once power down sequence is completed, AEPOL goes to idlemode 205 until the next timer interval.

The AEPOL referred to in FIG. 2 is implemented per core. The logic mayconstantly monitor architectural events to ensure cores are running init optimal power/performance state.

In one embodiment, architecture event counts of interest are counted andsent to the PCU 115. PCU 115 then analyzes the counts it receives fromeach counter and determines whether it should power up or power down aparticular core 105. In one embodiment, if a system interconnect (sharedcache, bus control logic, on-die memory control, etc.) also supportspower scaling, the same mechanism may be used to scale systeminterconnect logic.

In an embodiment, all EMON counters 130 monitored should be referencedtogether to better understand AEPOL behavior. For example, lowinstruction retired per cycle (IPC) count does not mean core is notrunning effectively unless we know it also suffers high cache miss orhigh branch misprediction.

As shown in Table 1 below, the architecture events of interests aregrouped together to make decisions. A threshold count for eacharchitecture event counter is also defined. The threshold value isdefined based on performance studies for a particular architecture, asperformance may differ depending on the architecture of the system. InTable 1, if all related architecture counters are low, this suggeststhat the system does not suffer from any system bound actions.Therefore, scaling up the frequency on the core does help increasing theperformance of the application. On the other hand, if the core issuffering rather high counts of MLC/LLC misses, there will be no benefitto increase core frequency since the performance is bounded by accesslatency to an off-chip component. In this situation, the system shouldscale down the core frequency and divert the saved power to other coresthat may be doing useful work.

Therefore, AEPOL allows for an intelligent decision making on when toturn on turbo where performance will benefit and can be observed and itlowers the power dissipation with fine tuning performance power state oncores that are stalling on instruction

TABLE 1 PCU decision tree per core based on architectural event countersArchi- Count Count Count Count Count Count tectural thres- thres- thres-thres- thres- thres- Events hold hold hold hold hold hold Inst. RetiredLow high low low low low MLC Miss low don't care high high low low LLCMiss low don't care high low don't care low TLB Miss low don't caredon't don't don't care high care care Branch low don't don't don't highdon't Miss care care care care Final Power Powr UP Power Power Power UpPower Decision UP Down Down Down

There can be many more scenarios or other useful architectural eventcounters that can do finer grain control of the core power usage and theAEPOL logic is applicable to all these situations.

With AEPOL optimization, the system is given a smarter way to utilizethe available power to the processor. In future processor design wherepower aware architecture must exist across the board, AEPOL not onlyprovides a way to conserve energy when it is not needed, it alsoprovides opportunity to optimize performance further within the samepower budget. This mechanism opens a whole new range of opportunity forfiner grain hardware tuning.

FIG. 3 illustrates a block diagram of a computing system 300 inaccordance with an embodiment of the invention. The computing system 300may include one or more central processing units(s) (CPUs) 31 orprocessors that communicate via an interconnection network (or bus) 49.The processors 31 may be any type of a processor such as a generalpurpose processor, a network processor (that processes data communicatedover a computer network 48, or other types of a processor (including areduced instruction set computer (RISC) processor or a complexinstruction set computer (CISC). Moreover, the processors 31 may have asingle or multiple core design. The processors 31 with a multiple coredesign may integrate different types of processor cores on the sameintegrated circuit (IC) die. Also, the processors 31 may utilize theembodiments discussed with references to FIGS. 1 and 2. For example, oneor more of the processors 31 may include one or more processor cores 32.Also, the operations discussed with reference to FIGS. 1 and 2 may beperformed by one or more components of the system 300.

A chipset 33 may also communicate with the interconnection network 49.The chipset 33 may include a memory control hub (MCH) 34. The MCH 34 mayinclude a memory controller 36 that communicates with a memory 41. Thememory 41 may store data and sequences of instructions that are executedby the CPU 31, or any other device included in the computing system 300.In one embodiment of the invention, the memory 41 may include one ormore volatile storage (or memory) devices such as random access memory(RAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), static RAM (SRAM),or the like. Nonvolatile memory may also be utilized such as a harddisk. Additional devices may communicate via the interconnection network49, such as multiple CPUs and/or multiple system memories.

The MCH 34 may also include a graphics interface 37 that communicateswith a graphics accelerator 42. In one embodiment of the invention, thegraphics interface 37 may communicate with the graphics accelerator 42via an accelerated graphics poet (AGP). In an embodiment of theinvention, a display (such as a flat panel display) may communicate withthe graphics interface 37 through, for example, a signal converter thattranslates a digital representation of an image stored in a storagedevice such as a video memory or system memory into display signals thatare interpreted and displayed by the display. The display signalsproduced by the display device may pass through various control devicesbefore being interpreted by and subsequently displayed on the display.

A hub interface 51 may allow the MCH 34 to communicate with aninput/output control hub (ICH) 38. The ICH 38 may provide an interfaceto I/O devices that communicate with components of the computing system300. The ICH 38 may communicate with a bus 47 through a peripheralbridge (or controller) 39, such as a peripheral component interconnect(PCI) bridge, a universal serial bus (USB) controller, or the like. Thebridge 39 may provide a data path between the CPU 31 and peripheraldevices. Other types of topologies may be utilized. Also, multiple busesmay communicate with the ICH 38, e.g. through multiple bridges orcontrollers. Moreover, other peripheral in communication with the ICH 38may include, in various embodiments of the invention, integrated driveelectronics (IDE) or small computer system interfaces (SCSI) harddrive(s), USB ports, a keyboard, a mouse, parallel port(s), serialport(s), floppy disk drive(s), digital output support (e.g., digitalvideo interface (DVI)), or the like.

The bus 47 may communicate with an audio device 43, one or more diskdrive(s) 44, and a network interface device 46 (which communicates withthe computer network 48). Other devices may be in communication with thebus 47. Also, various components (such as the network interface device46) may be in communication with the MCH 34 in some embodiments of theinvention. In addition, the processor 31 and the MCH 34 may be combinedto form a single chip. Furthermore, the graphics accelerator 42 may beincluded within the MCH 34 in other embodiments of the invention.

Furthermore, the computing system 300 may include volatile and/ornonvolatile memory (or storage). For example, nonvolatile memory mayinclude one or more of the following: read-only memory (ROM),programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM(EEPROM), a disk drive (e.g., 44) a floppy disk, a compact disk ROM(CD-ROM), a digital versatile disk (DVD), flash memory, amagneto-optical disk, or other types of nonvolatile machine-readablemedia capable of storing electronic instructions and/or data.

FIG. 4 illustrates a computing system 400 that is arranged in apoint-to-point (PtP) configuration, according to an embodiment of theinvention. In particular, FIG. 4 shows a system where processors,memory, and input/output devices are interconnected by a number of pointto point interfaces. The operations discussed with reference to FIGS.1-3 may be performed by one or more components of the system 400.

As illustrated in FIG. 4, the system 400 may include several processors,of which only two, processors 5, 10 are shown for clarity. Theprocessors 5, 10 may each include a local memory controller hub (MCH)15, 20 to allow communication with memories 15, 20. The memories 15,and/or 20 may store various data such as those discussed with referenceto the memory 512.

The processors 5, 10 may be any type of a processor such as thosediscussed with reference to the processors 31 of FIG. 3. The processors5, 10 may exchange data via a point-to-point interface 93 using PtPinterface circuits 40 and 45, respectively. The processors 5, 10 mayeach exchange data with a chipset 50 via individual PtP interfaces 55,60 using point to point interface circuits 65, 70, 75, 80. The chipset50 may also exchange data with a high-performance graphics circuit 37via a high performance graphic interface 97, using a PtP interfacecircuit 90.

At least one embodiment of the invention may be provided within theprocessors 5, 10. For example, one or more of the processor core (s) 32may be located within the processors 5, 10. Other embodiments of theinvention, however, may exist in other circuits, logic units, or deviceswith the system 400 of FIG. 6. Furthermore, other embodiments of theinvention may be distributed throughout several circuits, logic units,or devices illustrated in FIG. 4.

The chipset 50 may communicate with a bus 16 using a PtP interfacecircuit 95. The bus 16 may have one or more devices that communicatewith it, such as a bus bridge 18 and I/O devices 14. Via a bus 20, thebus bridge 14 may be in communication with other devices such as akeyboard/mouse 22, communication devices 26 (such as modems, networkinterface devices, etc. that may be in communication with the computernetwork 48), audio I/O devices, and/or a data storage device 28. Thedata storage device 28 may store code 30 that may be executed by theprocessors 5 and/or 10.

In various embodiments of the invention, the operations discussedherein, e.g., with reference to FIGS. 1-4 may be implemented by hardware(e.g., circuitry), software, firmware, microcode, or combinationsthereof, which may be provided as a computer program product, e.g.,including a machine readable or computer readable medium having storedthereon instructions (or software procedures) used to program a computerto perform a process discussed herein. Also, the term “logic” mayinclude, by way of example, software, hardware, or combinations ofsoftware and hardware. The machine readable medium may include a storagedevice such as those discussed with respect to FIGS. 1-4.

Additionally, such computer readable media may be downloaded as acomputer program product, wherein the program may be transferred from aremote computer (e.g., a server) to a requesting computer (e.g., client)by way of data signals embodied in a carrier wave or other propagationmedium via a communication link (e.g., a bus, a modem, or a networkconnection). Accordingly, herein, a carrier wave shall be regarded ascomprising a machine readable medium.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin connection with the embodiment is included in at least animplementation. The appearances of the phrase “in one embodiment” invarious places in the specification may or may not be all referring tothe same embodiment.

Also, in the description and claims, the term “coupled” and “connected”,along with their derivatives, may be used. In some embodiments of theinvention, “connected” may be used to indicate that two or more elementsare in direct physical or electrical contact with each other. “Coupled”may mean that two or more elements are in direct physical or electricalcontact. However, “coupled” may also mean that two or more elements maynot be in direct contact with each other, but may still cooperate orinteract with each other.

Thus, although embodiments have been described in language specific tostructural features and/or methodological acts, it is to be understoodthat claimed subject matter may not be limited to the specific featuresor acts described. Rather, the specific features and acts are disclosedas sample forms of implementing the claimed subject matter.

We claim:
 1. A system comprising: a plurality of processors; a firstinterconnect to couple two or more of the plurality of processors; asecond interconnect to couple one or more of the plurality of processorsto one or more other system components; and a system memory coupled toone or more of the processors; at least one of the processorscomprising: a plurality of last level cache (LLC) regions; a pluralityof cores coupled to one or more of the LLC regions, wherein a core ofthe plurality of cores comprises: a plurality of thermal sensors tocollect thermal data for the core, and a plurality of performancecounters to count architectural events within the core, at least onecounter to count completed instructions; and a power management unit tomanage power usage on a per core basis based on at least one ofavailable power, thermal readings from the plurality of thermal sensorsand/or architectural events counted by the performance counters, and toadjust a frequency of the core and to set a turbo mode based on the atleast one available power.
 2. The system as in claim 1 wherein theplurality of LLC regions comprise at least four LLC regions.
 3. Thesystem as in claim 1 wherein the plurality of cores comprise at leasteight cores.
 4. The system as in claim 1 further comprising: anaccelerator device coupled to one or more of the processors over thefirst, the second, or a third interconnect.
 5. The system as in claim 1wherein the system memory comprises a dynamic random access memory. 6.The system as in claim 1 further comprising: at least one communicationdevice coupled to one or more of the plurality of processors.
 7. Thesystem as in claim 1 further comprising: at least one storage devicecoupled to one or more of the plurality of processors.
 8. The system asin claim 1 further comprising: a graphics accelerator coupled to one ormore of the plurality of processors.
 9. The system as in claim 8 furthercomprising: a graphics interface to couple the graphics accelerator tothe one or more of the plurality of processors; and a display coupled tothe graphics accelerator through the graphics interface.
 10. The systemas in claim 7 further comprising: a signal converter that translates adigital representation of an image stored in a storage device intodisplay signals that are interpreted and displayed by the display. 12.The system as in claim 9 further comprising a video memory usable by thegraphics accelerator.
 13. The system as in claim 1 further comprising: auser input device coupled to one or more of the plurality of processorsover the second interconnect or a third interconnect.
 14. The system asin claim 1 further comprising: an audio device coupled to one or more ofthe plurality of processors.